# coding=utf-8

import smtplib
from email.mime.text import MIMEText
from email.header import Header

# sender
sender = 'wuzhiyi51@163.com'

# receiver
receiver = 'wuzhiyi51@sina.com'

# subject
subject = 'python email test'

# smpt Server
smtpserver = 'smtp.163.com'

# username, password
username = 'iamwuzhiyi@163.com'
password = '649911812'

msg = MIMEText(u'你好!!', 'text', 'utf-8')
msg['Subject'] = Header(subject, 'utf-8')

smtp = smtplib.SMTP()
smtp.connect('smtp.163.com', 25)
smtp.set_debuglevel(1)
smtp.login(username, password)
smtp.sendmail(sender, receiver, msg.as_string())
smtp.quit()
